Learn R Programming

Compositional (version 1.4)

Regularised discriminant analysis for compositional data using the alpha-transformation: Regularised discriminant analysis for compositional data using the $\alpha$-transformation

Description

Regularised discriminant analysis for compositional data using the $\alpha$-transformation.

Usage

alfa.rda(xnew, x, ina, a, gam = 1, del = 0)

Arguments

xnew
A matrix with the new compositional data whose group is to be predicted. Zeros are allowed, but you must be carefull to choose strictly positive vcalues of $\alpha$.
x
A matrix with the available compositional data. Zeros are allowed, but you must be carefull to choose strictly positive vcalues of $\alpha$.
ina
A group indicator variable for the avaiable data.
a
The value of $\alpha$ for the $\alpha$-transformation.
gam
This is a number between 0 and 1. It is the weight of the pooled covariance and the diagonal matrix.
del
This is a number between 0 and 1. It is the weight of the LDA and QDA.

Value

A list including:
prob
The estimated probabilities of the new data of belonging to each group.
scores
The estimated socres of the new data of each group.
est
The estimated group membership of the new data.

Details

The covariance matrix of each group is calcualted and then the pooled covariance matrix. The spherical covariance matrix consists of the average of the pooled variances in its diagonal and zeros in the off-diagonal elements. gam is the weight of the pooled covariance matrix and 1-gam is the weight of the spherical covariance matrix, Sa = gam * Sp + (1-gam) * sp. Then it is a compromise between LDA and QDA. del is the weight of Sa and 1-del the weight of each group covariance group. This function is a wrapper for alfa.rda.

References

Friedman Jerome, Trevor Hastie and Robert Tibshirani (2009). The elements of statistical learning, 2nd edition. Springer, Berlin

Tsagris Michail, Simon Preston and Andrew TA Wood (2016). Improved classification for compositional data using the $\alpha$-transformation. Journal of classification (to appear). http://arxiv.org/pdf/1106.1451.pdf

See Also

rda, alfa

Examples

Run this code
x <- iris[, 1:4]
ina <- iris[, 5]
mod <- alfa.rda(x, x, ina, 0)
table(ina, mod$est)
mod2 <- alfa.rda(x, x, ina, 0.5)
table(ina, mod2$est)

Run the code above in your browser using DataLab